package com.fessc.develop.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fessc.develop.entity.dbvo.TCheckDetail;
import com.fessc.develop.mapper.TCheckDetailMapper;
import com.fessc.develop.service.interfaces.ITCheckDetailService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author y
 * @since 2024-06-26
 */
@Service
public class TCheckDetailServiceImpl extends ServiceImpl<TCheckDetailMapper, TCheckDetail> implements ITCheckDetailService {

    @Resource
    private TCheckDetailMapper checkDetailMapper;

    /**
     * 根据银行编号、对账日期和对账类型，删除对账明细记录
     *
     * @param bankId 银行编号
     * @param checkDate 对账日期
     * @param checkType 对账类型
     */
    @Override
    public void deletCheckDetailByDate(String bankId, Date checkDate, String checkType) {
        checkDetailMapper.deletCheckDetailByDate(bankId, checkDate, checkType);
    }

    /**
     * 根据银行编号、对账日期、对账类型和有效状态，更新对账明细记录
     *
     * @param effectiveStatus 有效状态
     * @param bankId 银行编号
     * @param checkDate 对账日期
     * @param checkType 对账类型
     */
    @Override
    public void updateCheckDetailByDate(String effectiveStatus, String bankId, Date checkDate, String checkType) {
        checkDetailMapper.updateCheckDetailByDate(effectiveStatus, bankId, checkDate, checkType);
    }

    /**
     * 根据银行编号、对账日期、对账类型和有效状态，查询预付款对账记录
     *
     * @param bankId 银行编号
     * @param checkDate 对账日期
     * @param checkType 对账类型
     * @return 预付款对账集合
     */
    @Override
    public List<TCheckDetail> getPrePaymentResultByCheckDate(String bankId, Date checkDate, String checkType) {
        return checkDetailMapper.getPrePaymentResultByCheckDate(bankId, checkDate, checkType);
    }

    /**
     * 根据银行编号、对账日期、对账类型和有效状态，查询预付款退款对账记录
     *
     * @param bankId 银行编号
     * @param checkDate 对账日期
     * @param checkType 对账类型
     * @return 预付款退款对账集合
     */
    @Override
    public List<TCheckDetail> getPrePaymentRefundResultByCheckDate(String bankId, Date checkDate, String checkType) {
        return checkDetailMapper.getPrePaymentRefundResultByCheckDate(bankId, checkDate, checkType);
    }

    /**
     * @param bankId    银行编号
     * @param checkDate 对账日期
     * @param checkType 对账类型
     * @return
     */
    @Override
    public List<TCheckDetail> getSettleResultByCheckDate(String bankId, Date checkDate, String checkType) {
        return checkDetailMapper.getSettleResultByCheckDate(bankId, checkDate, checkType);
    }
}
